package org.sklse.learningassistant.service;

import java.util.List;

import javax.annotation.Resource;

import org.sklse.learningassistant.bean.Plan;
import org.sklse.learningassistant.bean.Sign;
import org.sklse.learningassistant.dao.PlanDao;
import org.sklse.learningassistant.repository.PlanRepository;
import org.springframework.stereotype.Service;

@Service
public class PlanService {

	@Resource
	private PlanRepository planRepository;
	
	@Resource
	private PlanDao planDao;
	
	public List<Plan> getPlan(){
		return planDao.getPlan();
	}
	
	public List<Sign> getSign(Integer pID) {
		return planDao.getSign(pID);
	}
	public void addSign(Integer pID, Integer total_num) {
		planDao.addSign(pID, total_num);
	}
	
	public void updatePlan(String p_name, String description, Integer signed_num, Integer total_num, Integer pID) {
		planDao.updatePlan(p_name, description, signed_num, total_num, pID);
	}

	public void deletePlan(Integer pID) {
		planDao.deletePlan(pID);
	}

	public void sign(Integer pID, Integer day, Integer signedNum) {
		planDao.sign(pID, day, signedNum);
	}
}
